Repository navigation
fix(scope): judge a linked path by its target as well - #2
Merged
Merged
Conversation
File group rows are keyed by name, and absoluteOf() follows a link, so a link inside the root was a second name that carried none of the restrictions of the file it reached. canRead() and canWrite() now ask about both names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
file_groupsrows are keyed by name, andabsoluteOf()follows links. A link inside the root was therefore a second name for a file that carried none of its restrictions:canRead()judged the name of the link, andread()returned the target. A manager outside the group could read, list and write through it.Change
canRead()andcanWrite()now ask about both names, the path given and where it really is. A path that does not exist yet is judged by its nearest existing ancestor, so a write through a linked folder is covered too. A manager who may see the target still reaches it through the link.Administrators and sites without restrictions take the same early return as before.
Tests
Two new tests with real symlinks:
canRead,read,canWriteandlistImagesfor a manager outside the group, and access through the link for a member. The first failed before the fix. Full suite on Linux: 256 passed. Link tests skip on a system that cannot create links, so run them on Linux.🤖 Generated with Claude Code